﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using YuYuKiCms.Framework.Localization;

namespace YuYuKiCms.Model
{
    public class PageVm
    {
        [HiddenInput]
        public Int32? Id { get; set; }

        [HiddenInput]
        public Int32? IdParent { get; set; }

        [HiddenInput]
        public Int32 Rank { get; set; }

        [Required]
        [DisplayNameFromDb("Title")]
        public string Title { get; set; }

        [Required]
        [DisplayNameFromDb("Url_title")]
        [RemoteFromDb("IsUrlTitleUniq", "Validation", "url_title_is_already_used")]
        public string UrlTitle { get; set; }

        [DataType(DataType.DateTime)]
        [DisplayNameFromDb("Publish_date")]
        public DateTime? PublishDate { get; set; }

        [DataType(DataType.DateTime)]
        [DisplayNameFromDb("ExpireDate_date")]
        public DateTime? ExpireDate { get; set; }

        [HiddenInput]
        public bool Published { get; set; }

        public int Order { get; set; }
    }
}